package com.sky.mapper;

import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface OrderDetailMapper {

    // 批量插入订单明细数据
    void insertBatch(List<OrderDetail> orderDetailList);



    @Select("select * from orders where id = #{id}")
    Orders getById(Long id);

    @Update("update orders set status = #{status} where id = #{id}")
    void update(Orders orders);

    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);
}
